package com.ruoyi.integration.controller;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.integration.service.InverseService;
import com.ruoyi.integration.vo.WebMapUrlVO;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "WebMapService服务获取接口")
@RestController
@RequestMapping("/integration/index")
@RequiredArgsConstructor
public class WebMapController {

    private final InverseService inverseService;

    @GetMapping("/getWMSUrl")
    public R<WebMapUrlVO> getWMSUrl(@RequestParam("minioBucket") String minioBucket,
                                    @RequestParam("fileName") String fileName) {

        WebMapUrlVO webMapUrlVO = inverseService.getWebMapServiceUrl(minioBucket, fileName);
        return R.ok(webMapUrlVO, "获取WMS服务地址成功");
    }


}
